<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ include file="../base.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>数据 - AdminLTE2定制版</title>
    <meta name="description" content="AdminLTE2定制版">
    <meta name="keywords" content="AdminLTE2定制版">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 页面meta /-->
    <script src="${ctx}/plugins/jQuery/jquery-2.2.3.min.js"></script>
</head>
<body>

<div id="frameContent" class="content-wrapper" style="margin-left:0px;">
    <!-- 内容头部 -->
    <section class="content">
        <div class="row">
            <!-- /.col -->
            <div class="col-md-12">
                <div class="box box-primary">
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                        <div class="mailbox-controls">
                            <!-- Check all button -->
                            <div class="btn-group">
                                <button type="button"  class="btn btn-primary btn-lg" onclick="document.getElementById('exportForm').submit()"><i class="fa fa-trash-o"></i></button>
                                <button type="button" class="btn btn-primary btn-lg" id="back"><i class="fa fa-reply"></i></button>
                                <button type="button" class="btn btn-primary btn-lg" id="go"><i class="fa fa-share"></i></button>
                                <button type="button" class="btn btn-primary btn-lg" onclick='view()'><i class="fa  fa-play"></i></button>
                            </div>
                            <!-- /.btn-group -->
                            <button type="button" class="btn btn-primary btn-lg" id="re"><i class="fa fa-refresh"></i></button>

                            <!-- /.pull-right -->
                        </div>
                        <div class="table-responsive mailbox-messages">
                            <table class="table table-hover table-striped">
                                <form id="exportForm" action="/user/oldread/delete.do" method="post">                                <thead>
                                <tr>
                                    <th class="sorting"></th>
                                    <th class="sorting">来源</th>
                                    <th class="sorting">内容</th>
                                    <th class="sorting">发送的时间</th>
                                </tr>
                                </thead>
                                <c:forEach items="${olddata}" var="item"  varStatus="st">
                                <tr>
                                    <td>
                                        <input type="checkbox" name="id" value="${item.id}"></td>
                                    </td>
                                    <td class="mailbox-name"><a>${user.userName}</a></td>
                                    <td class="mailbox-subject"><b>${item.textarea}</b>
                                    </td>
                                    <td class="mailbox-date">${item.create_time}</td>
                                </tr>
                                </c:forEach>
                                </form>
                                </tbody>
                            </table>
                            <!-- /.table -->
                        </div>
                        <!-- /.mail-box-messages -->
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer no-padding">

                    </div>
                </div>
                <!-- /. box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
    <!-- 正文区域 /-->
</div>
<!-- 内容区域 /-->
</body>

<script>
    /*页面的前进*/
$("#back").click(function () {
        history.back();
    });
    $("#go").click(function () {
        history.go();
    });
    $("#re").click(function() {
       location.reload(true);
    });
    $("#reset").click(function () {
        $("#file").val("");
        $("#compose-textarea").val("");
        $("#polaris-radio-1").val("");
        $("#polaris-radio-2").val("")
    })
</script>
<script>
    function view() {
        var id = getCheckId();
        if(id) {
            location.href="/user/oldread/toView.do?id="+id;
        }else{
            alert("请勾选待处理的记录，且每次只能勾选一个")
        }
    }
</script>
</html>